<#include "header.htm"/>

<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>
<script type="text/javascript">
<!--
<#include "js/utils.js">
-->
</script>


<#import "../macros/search_pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>


	<div class="pagination">
						<#assign paginationData>
							<@pagination.searchPagination/>
						</#assign>
						${paginationData}
   	</div>
				
				<#if results.size() == 0>
					   <div class="panel" id="message">
					    	<div class="inner"><span class="corners-top"><span></span></span>
					    		<h2>${I18n.getMessage("Information")}</h2>
					    		<p>${I18n.getMessage("Search.noResults")} <a href="${JForumContext.encodeURL("/search/filters")}">${I18n.getMessage("Search.clickHere")}</a> ${I18n.getMessage("Search.newSearch")}</p>
					    		<span class="corners-bottom"><span></span></span>
					    	</div>
					    </div>
				<#else>
				   <h2>
				   			${I18n.getMessage("Search.searchFound")}
							${totalRecords} 
							
							<#if (totalRecords == 1)>
								${I18n.getMessage("Search.match")}
							<#else>
								${I18n.getMessage("Search.matches")}
							</#if>
				   </h2>


					<#list results as post>
					<#if post_index % 2 == 0>
						<#assign rowColor = "bg2">
					<#else>
						<#assign rowColor = "bg1">
					</#if>
					
					<#assign topic = post.topic />
					<#assign forum = post.forum />


					<div class="search post ${rowColor}">
		            	<div class="inner"><span class="corners-top"><span></span></span>
		            	<div class="postbody">
		            			<h3><a href="${JForumContext.encodeURL("/posts/preList/${post.topicId}/${post.id}${extension}#${post.id}", "")}">${topic.title?default("Empty")?html}</a></h3>
		            			<div class="content">${post.text}</div>
		            			<!-- Attachments -->
							<#if post.hasAttachments() && (canDownloadAttachments || attachmentsEnabled)>
								<#assign attachments = am.getAttachments(post.id, post.forumId)/>
							</#if>
		           		</div>
		           		<dl class="postprofile">
		           		                               
		           			<dt class="author">${I18n.getMessage("by")}&nbsp;<a href="${JForumContext.encodeURL("/user/profile/${post.userId}")}" style="color: #AA0000;" class="username-coloured">${post.postUsername?html}</a></dt>
		           			<dd>${post.time?datetime?string}</dd>
		           			<dd>&nbsp;</dd>
		           			<dd>${I18n.getMessage("PostShow.forum")}: <a href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name?html}</a></dd>
		           			<dd>${I18n.getMessage("PostShow.topic")}: <a href="${JForumContext.encodeURL("/posts/list/${topic.id}")}">
		           				<#if (topic.title?length == 0)>
		           					No Subject
		           				<#else>
		           					${topic.title?html}
		           				</#if>
		           			
		           			</a></dd>
		           			<dd>${I18n.getMessage("ForumIndex.replies")}: <strong>${topic.totalReplies}</strong></dd>
		           			<dd>${I18n.getMessage("ForumIndex.views")}: <strong>${topic.totalViews}</strong></dd>
		           		</dl>
		           		<ul class="searchresults">
		           			<li><a href="${JForumContext.encodeURL("/posts/preList/${post.topicId}/${post.id}${extension}#${post.id}", "")}" class="right">${I18n.getMessage("PostShow.jumpToPost")}</a></li>
		           		</ul>
		           		<span class="corners-bottom"><span></span></span>
		           		</div>
		           	</div>
					    
					    
					    
					    
					    
					    
					    

					</#list>
				</#if>

	<div class="pagination">
		${paginationData}
   	</div>
				


									<@presentation.forumsComboTable/>
<#include "bottom.htm"/>
